package com.wangshouyu.mp.pay.v3.transactions;

import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.google.gson.annotations.SerializedName;

import java.io.Serializable;
import java.util.List;
import java.util.Objects;

/**
 * @author 王守钰
 * @program wsy-mp-pay
 * @date 2020年08月15日 00:26
 * @description: 交易优惠
 */
public class TransactionsPromotionDetail implements Serializable {

    /**
     * 券ID
     */
    @SerializedName(value = "coupon_id")
    @JsonProperty(value = "coupon_id")
    @JSONField(name = "coupon_id")
    private String couponId;

    /**
     * 优惠名称
     */
    @SerializedName(value = "name")
    @JsonProperty(value = "name")
    @JSONField(name = "name")
    private String name;

    /**
     * 优惠范围
     */
    @SerializedName(value = "scope")
    @JsonProperty(value = "scope")
    @JSONField(name = "scope")
    private String scope;

    /**
     * 优惠类型
     */
    @SerializedName(value = "type")
    @JsonProperty(value = "type")
    @JSONField(name = "type")
    private String type;

    /**
     * 优惠券面额
     */
    @SerializedName(value = "amount")
    @JsonProperty(value = "amount")
    @JSONField(name = "amount")
    private Integer amount;

    /**
     * 活动ID
     */
    @SerializedName(value = "stock_id")
    @JsonProperty(value = "stock_id")
    @JSONField(name = "stock_id")
    private String stockId;

    /**
     * 微信出资
     */
    @SerializedName(value = "wechatpay_contribute")
    @JsonProperty(value = "wechatpay_contribute")
    @JSONField(name = "wechatpay_contribute")
    private Integer wechatpayContribute;

    /**
     * 商户出资
     */
    @SerializedName(value = "merchant_contribute")
    @JsonProperty(value = "merchant_contribute")
    @JSONField(name = "merchant_contribute")
    private Integer merchantContribute;

    /**
     * 其他出资
     */
    @SerializedName(value = "other_contribute")
    @JsonProperty(value = "other_contribute")
    @JSONField(name = "other_contribute")
    private Integer otherContribute;

    /**
     * 优惠币种
     */
    @SerializedName(value = "currency")
    @JsonProperty(value = "currency")
    @JSONField(name = "currency")
    private String currency;

    /**
     * 单品列表
     */
    @SerializedName(value = "goods_detail")
    @JsonProperty(value = "goods_detail")
    @JSONField(name = "goods_detail")
    private List<TransactionsGoodsDetail> goodsDetail;

    public String getCouponId() {
        return couponId;
    }

    public void setCouponId(String couponId) {
        this.couponId = couponId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getScope() {
        return scope;
    }

    public void setScope(String scope) {
        this.scope = scope;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public String getStockId() {
        return stockId;
    }

    public void setStockId(String stockId) {
        this.stockId = stockId;
    }

    public Integer getWechatpayContribute() {
        return wechatpayContribute;
    }

    public void setWechatpayContribute(Integer wechatpayContribute) {
        this.wechatpayContribute = wechatpayContribute;
    }

    public Integer getMerchantContribute() {
        return merchantContribute;
    }

    public void setMerchantContribute(Integer merchantContribute) {
        this.merchantContribute = merchantContribute;
    }

    public Integer getOtherContribute() {
        return otherContribute;
    }

    public void setOtherContribute(Integer otherContribute) {
        this.otherContribute = otherContribute;
    }

    public String getCurrency() {
        return currency;
    }

    public void setCurrency(String currency) {
        this.currency = currency;
    }

    public List<TransactionsGoodsDetail> getGoodsDetail() {
        return goodsDetail;
    }

    public void setGoodsDetail(List<TransactionsGoodsDetail> goodsDetail) {
        this.goodsDetail = goodsDetail;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        TransactionsPromotionDetail that = (TransactionsPromotionDetail) o;
        return Objects.equals(couponId, that.couponId) &&
                Objects.equals(name, that.name) &&
                Objects.equals(scope, that.scope) &&
                Objects.equals(type, that.type) &&
                Objects.equals(amount, that.amount) &&
                Objects.equals(stockId, that.stockId) &&
                Objects.equals(wechatpayContribute, that.wechatpayContribute) &&
                Objects.equals(merchantContribute, that.merchantContribute) &&
                Objects.equals(otherContribute, that.otherContribute) &&
                Objects.equals(currency, that.currency) &&
                Objects.equals(goodsDetail, that.goodsDetail);
    }

    @Override
    public int hashCode() {
        return Objects.hash(couponId, name, scope, type, amount, stockId, wechatpayContribute, merchantContribute, otherContribute, currency, goodsDetail);
    }

    @Override
    public String toString() {
        return "TransactionsPromotionDetail{" +
                "couponId='" + couponId + '\'' +
                ", name='" + name + '\'' +
                ", scope='" + scope + '\'' +
                ", type='" + type + '\'' +
                ", amount=" + amount +
                ", stockId='" + stockId + '\'' +
                ", wechatpayContribute=" + wechatpayContribute +
                ", merchantContribute=" + merchantContribute +
                ", otherContribute=" + otherContribute +
                ", currency='" + currency + '\'' +
                ", goodsDetail=" + goodsDetail +
                '}';
    }
}
